/*
 * ManagerSelector.h
 *
 *  Created on: 2013-2-1
 *      Author: Dspark
 */

#ifndef MANAGERSELECTOR_H_
#define MANAGERSELECTOR_H_
#include <qwidget.h>
#include <qtableview.h>
#include <qlayout.h>
#include <qlabel.h>
#include <qpushbutton.h>
#include <qstandarditemmodel.h>
#include "../../bo/User.h"
#include "../../utile/DAObject.h"
class ManagerSelector: public QWidget {
	Q_OBJECT
public:
	ManagerSelector();
	virtual ~ManagerSelector();
	QList<quint32>& getSelectedUserId();
	void load(User& actor);
	void load(quint32 projectId);
	void clearData();
protected:
	void initUI();
protected Q_SLOTS:
	void slt_poolDoubleClicked(const QModelIndex &index);
	void slt_selectionDoubleClicked(const QModelIndex &index);
	void slt_2SelectionClicked();
	void slt_2PoolClicked();
	void adjustButton();
private:
	QTableView selected,pool;
	QStandardItemModel selectedModel, poolModel;
	QHBoxLayout layout;
	QVBoxLayout selectionLayout,buttonLayout,poolLayout;
	QLabel selectionTitle, poolTitle;
	QPushButton add2Selection, add2Pool;
	QList<quint32> selectedId;
};

#endif /* MANAGERSELECTOR_H_ */
